<admintpl file="header" />
<!-- Bootstrap -->


<link href="__TMPL__Public/assets/css/infomation.css" rel="stylesheet" />
<link href="__PUBLIC__/js/jquery-ui/jquery-ui.min.css" rel="stylesheet" />



</head>
<body>

    <div class="wrap">
        <ul class="nav nav-tabs">
           	<li><a href="{:U('ExecutingWeeklyReport/sg')}">施工周报管理</a></li>
            <li><a href="{:U('ExecutingWeeklyReport/sg_add')}">添加施工周报</a></li>
            <li class="active"><a href="{:U('ExecutingWeeklyReport/sg_add', array('id'=>I('request.id/s','')))}">编辑施工周报</a></li>
        </ul>
        <section class="tab-pane active fade in" id="access">

            <div class="row">
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="panel panel-info">

                        <div class="panel-body">
                            <form class="js-ajax-form form-horizontal form-inline tg" action="{:U('ExecutingWeeklyReport/sgedit_post')}" method="post">
                                <input type="hidden" name="id" value="{$result.id}" />
                                <input type="hidden" name="report_type" value="1" />
                                <div class="text-center">
                                    <h2>
                                        <input type="text" name="company_name" class="input-xt input-longname" style="width:600px; color:#D6D6D6; "  value="{$result.company_name}" />
                                        <p></p>  
                                        <small>施 工 周 报</small>
                                        <small><select name="report_year">
                                        	<php>
                                            	for($i = (date('Y') - 5); $i < (date('Y') + 2); $i++){
                                                	echo "<option value=$i ".($result['report_year'] == $i ? "selected" : "")." >$i</option>";
                                                }
                                            </php>
                                        </select>
                                        第(<input type="text" name="code" class="input-xt input-num" value="{$result.code}" />)期</small>
                                    </h2>
                                </div>
                                <div class="row tg-header">
                                    <div class="col-md-12">
                                        <p class="tg-content">
                                            <label>工程名称：</label>
                                            <input type="text" class="input-xt input-deptname" value="{$job_name}" />
                                        </p>
                                        <p class="tg-content">
                                            <label>施工时间:</label>
                                            <input type="text" name="being_date" id="from" class="input-xt input-name" value="{$result.being_date}" />
                                            -
                                            <input type="text" name="end_date" id="to" class="input-xt input-name" value="{$result.end_date}" />
                                        </p>
                                    </div>
                                </div>
                                <div class="well">


                                    <fieldset>
                                        <ul class="list-unstyled">
                                            <li>
                                                <h5>一、上周相关问题落实和解决情况：</h5>
                                                <div class="tg-content">
                                                    <script type="text/plain"  name="this_week_problem" id="content">{$result.this_week_problem}</script>
                                                </div>
                                            </li>

                                            <li>
                                                <h5>
                                                    二、本周工程完成情况
                                                </h5>
                                                <div class="tg-content">
                                                    <script type="text/plain"  name="this_week_summary" id="content1">{$result.this_week_summary}</script>
                                                </div>
                                            </li>
                                            <li>
                                                <h5>
                                                    三、本周及下周计划投入劳动力、材料、设备进场情况
                                                </h5>
                                                <!-- Custom Tabs -->
                                                <div class="nav-tabs-custom tab-info">
                                                    <ul class="nav nav-tabs nav-pills">
                                                        <li class="active"><a href="#tab_1" data-toggle="tab">劳动力进场</a></li>
                                                        <li><a href="#tab_2" data-toggle="tab">材料进场</a></li>
                                                        <li><a href="#tab_3" data-toggle="tab">设备进场</a></li>
                                                    </ul>
                                                    <div class="tab-content">
                                                        <div class="tab-pane active" id="tab_1">
                                                            <table class="table table-bordered table-condensed" style="width:50%">
                                                                <thead>
                                                                    <tr>
                                                                        <th>工种</th>
                                                                        <th>本周人数(人)</th>
                                                                        <th>下周人数(人)</th>
                                                                        <th><a class="btn addLine" href="javascript:void(0);" type="1" >添加</a></th>
                                                                    </tr>
                                                                </thead>
                                                                <tbody>
                                                                    <foreach name="labels1" item="vo">
                                                                        <tr>
                                                                            <td><input type="text" name="job_name[]" value="{$vo.job_name}" /></td>
                                                                            <td><input type="text" name="this_week_count[]" value="{$vo.this_week_count}" /></td>
                                                                            <td><input type="text" name="next_week_count[]"  value="{$vo.next_week_count}"/></td>
                                                                            <td>
                                                                                <input type="hidden" name="plan_type[]" value="{$vo.plan_type}" >
                                                                                <a class="btn delLine" href="javascript:void(0);">删除</a>
                                                                            </td>
                                                                        </tr>
                                                                    </foreach>
                                                                </tbody>
                                                            </table>
                                                        </div>
                                                        <!-- /.tab-pane -->
                                                        <div class="tab-pane" id="tab_2">
                                                            <table class="table table-bordered table-condensed" style="width:50%">
                                                                <thead>
                                                                    <tr>
                                                                        <th>材料类型</th>
                                                                        <th>本周</th>
                                                                        <th>下周</th>
                                                                        <th><a class="btn addLine" href="javascript:void(0);" type="1" >添加</a></th>
                                                                    </tr>
                                                                </thead>
                                                                <tbody>
                                                                    <foreach name="labels2" item="vo">
                                                                        <tr>
                                                                            <td><input type="text" name="job_name[]" value="{$vo.job_name}" /></td>
                                                                            <td><input type="text" name="this_week_count[]" value="{$vo.this_week_count}" /></td>
                                                                            <td><input type="text" name="next_week_count[]"  value="{$vo.next_week_count}"/></td>
                                                                            <td>
                                                                                <input type="hidden" name="plan_type[]" value="{$vo.plan_type}" >
                                                                                <a class="btn delLine" href="javascript:void(0);">删除</a>
                                                                            </td>
                                                                        </tr>
                                                                    </foreach>
                                                                </tbody>
                                                            </table>
                                                        </div>
                                                        <!-- /.tab-pane -->
                                                        <div class="tab-pane" id="tab_3">
                                                            <table class="table table-bordered table-condensed" style="width:50%">
                                                                <thead>
                                                                    <tr>
                                                                        <th>设备名称</th>
                                                                        <th>本周</th>
                                                                        <th>下周</th>
                                                                        <th><a class="btn addLine" href="javascript:void(0);" type="1" >添加</a></th>
                                                                    </tr>
                                                                </thead>
                                                                <tbody>
                                                                    <foreach name="labels3" item="vo">
                                                                        <tr>
                                                                            <td><input type="text" name="job_name[]" value="{$vo.job_name}" /></td>
                                                                            <td><input type="text" name="this_week_count[]" value="{$vo.this_week_count}" /></td>
                                                                            <td><input type="text" name="next_week_count[]"  value="{$vo.next_week_count}"/></td>
                                                                            <td>
                                                                                <input type="hidden" name="plan_type[]" value="{$vo.plan_type}" >
                                                                                <a class="btn delLine" href="javascript:void(0);">删除</a>
                                                                            </td>
                                                                        </tr>
                                                                    </foreach>

                                                                </tbody>
                                                            </table>
                                                        </div>
                                                        <!-- /.tab-pane -->
                                                    </div>
                                                    <!-- /.tab-content -->
                                                </div>
                                                <!-- nav-tabs-custom -->

                                            </li>
                                            <li>
                                                <h5>
                                                    四、进度目标
                                                </h5>
                                                <div class="tg-content">
                                                    <script type="text/plain"  name="prograss_goal" id="content2">{$result.prograss_goal}</script>
                                                </div>
                                            </li>
                                            <li>
                                                <h5>
                                                    五、下周施工计划
                                                </h5>
                                                <div class="tg-content">
                                                    <script type="text/plain"  name="next_week_plan" id="content3">{$result.next_week_plan}</script>
                                                </div>
                                            </li>
                                            <li>
                                                <h5>
                                                    六、需业主协调事宜
                                                </h5>
                                                <div class="tg-content">
                                                    <script type="text/plain"  name="contractor_problem" id="content4">{$result.contractor_problem}</script>
                                                </div>
                                            </li>

                                        </ul>
                                    </fieldset>
                                    <div class="signature">
                                        <p>
                                            杭州建工杭州市中医院丁桥分院项目部
                                        </p>


                                    </div>
                                    <p class="signature-date">
                                        <span>年</span>
                                        <span>月</span>
                                        <span>日</span>
                                    </p>

                                </div>
                                <div class="form-actions">
                                    <button type="submit" class="btn btn-primary js-ajax-submit">{:L('SAVE')}</button>
                                    <if condition="$Role == 0 || $Role == 3">
                                        <input type="hidden" name="is_publish" id="is_publish" value="$result.is_publish">
                                        <input type="submit" class="btn btn-warning" id="btnPublish" value="发布">
                                    </if>
                                    <a class="btn btn-default" href="javascript:history.back(-1);">{:L('BACK')}</a>
                                </div>

                            </form>

                        </div>
                    </div>
                </div>

            </div>

        </section>
    </div>
     <script src="__PUBLIC__/js/common.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/jquery-ui/jquery-ui.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/jquery-ui/datepicker-zh-CN.js"></script>
    <script type="text/javascript">

        $(function () {
            $("#from").datepicker({
                dateFormat: "yy-mm-dd",
                defaultDate: "",
                changeMonth: true,
                changeYear: true,
                numberOfMonths: 1,
                onClose: function (selectedDate) {
                    $("#to").datepicker("option", "minDate", selectedDate);
                }
            });
            $("#to").datepicker({
                defaultDate: "",
                changeMonth: true,
                changeYear: true,
                numberOfMonths: 1,
                onClose: function (selectedDate) {
                    $("#from").datepicker("option", "maxDate", selectedDate);
                }
            });
        });
    </script>
    <script type="text/javascript">
        //编辑器路径定义
        var editorURL = GV.WEB_ROOT;
    </script>
    <script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript">
        var editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');
        var editorcontent1 = new baidu.editor.ui.Editor();
        editorcontent1.render('content1');
        var editorcontent2 = new baidu.editor.ui.Editor();
        editorcontent2.render('content2');
        var editorcontent3 = new baidu.editor.ui.Editor();
        editorcontent3.render('content3');
        var editorcontent4 = new baidu.editor.ui.Editor();
        editorcontent4.render('content4');
    </script>
        <script type="text/javascript">
        $(document).ready(function(e) {
            $(".addLine").click(function(){
                var html =  "<tr>" +
                            "   <td><input type=\"text\" name=\"job_name[]\" /></td>" +
                            "   <td><input type=\"text\" name=\"this_week_count[]\" /></td>" +
                            "   <td><input type=\"text\" name=\"next_week_count[]\" /></td>" +
                            "   <td>" +
                            "       <input type=\"hidden\" name=\"plan_type[]\" value=\""+$(this).attr("type")+"\" >" +
                            "       <a class=\"btn delLine\" href=\"javascript:void(0);\">删除</a>" +
                            "   </td>" +
                            "</tr>";
                $(this).closest("thead").next().append(html);
            });
            // 删除一行
            $(document).on("click", ".delLine", function(){
                $(this).closest("tr").remove();
            });
        });
    </script>
</body>
</html>